﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.ServiceLocation;

namespace StatusBarModule
{
    [Module(ModuleName="StatusBarModule",OnDemand=false)]
    public class StatusBarModule : IModule
    {
           //private readonly IRegionManager _regionManager;
           //private readonly IUnityContainer _container;
           //private readonly IEventAggregator _eventAggregator;
   
           //public StatusBarModule(IUnityContainer container, IRegionManager regionManager, IEventAggregator eventAggregator)
           //{
           //    _container = container;
           //    _regionManager = regionManager;
           //    _eventAggregator = eventAggregator;
           //}
   
           public void Initialize()
           {
               //RegisterViewsAndServices();

               var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
               regionManager.RegisterViewWithRegion("StatusBarRegion", typeof(StatusBar));
   
               //IStatusBarPresentationModel model = _container.Resolve<StatusBarPresentationModel>();
               //IRegion statusBarRegion = _regionManager.Regions["StatusBarRegion"];
               //statusBarRegion.Add(model.View);
               //statusBarRegion.Activate(model.View);
           }
   
           public void RegisterViewsAndServices()
           {
               //_container.RegisterType<IStatusBarView, StatusBarView>(new ContainerControlledLifetimeManager());
               //_container.RegisterType<IStatusBarPresentationModel, StatusBarPresentationModel>(new ContainerControlledLifetimeManager());
           }
    }
}
